/**
 * 在A数组的第K个位置插入一个数
 */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vll = vector<llt>;

template<typename T>
istream & operator >> (istream & is, vector<T> & v){
    for(auto & i : v) is >> i;
    return is;
}

template<typename T>
void input(vector<T> & v, int n){
    v.assign(n + 1, {});
    for(int i=1;i<=n;++i) cin >> v[i];
    return;
}

int N, K, X;
vi A;

void work(){
    cin >> N >> K >> X;
    A.assign(N, {});
    cin >> A;
    A.insert(A.begin() + K, X);
    for(auto i : A) cout << i << " ";
    cout << endl;
    return;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--) work();
    return 0;
}